package com.crois.barrier.common.constants;

import java.util.concurrent.TimeUnit;

/**
 * @author Hou Ze Yu
 * @description Constants
 * @date 2021/4/20
 */
public interface Constants {

    /**
     * The constant DECODE.
     */
    String DECODE = "UTF-8";

    String USE_ONLY_SITE_INTERFACES = "barrier.inetutils.use-only-site-local-interfaces";
    String PREFERRED_NETWORKS = "barrier.inetutils.preferred-networks";
    String IGNORED_INTERFACES = "barrier.inetutils.ignored-interfaces";
    String IP_ADDRESS = "barrier.inetutils.ip-address";
    String PREFER_HOSTNAME_OVER_IP = "barrier.inetutils.prefer-hostname-over-ip";
    String SYSTEM_PREFER_HOSTNAME_OVER_IP = "barrier.preferHostnameOverIp";
    String BARRIER_SERVER_IP = "barrier.server.ip";

     long DEFAULT_BARRIER_HEART_BEAT_TIMEOUT = TimeUnit.SECONDS.toMillis(15);

     long DEFAULT_BARRIER_IP_DELETE_TIMEOUT = TimeUnit.SECONDS.toMillis(30);

     long DEFAULT_BARRIER_HEART_BEAT_INTERVAL = TimeUnit.SECONDS.toMillis(5);




    Integer API_PARAMETER_INFO_POSITION_TYPE = 1;
    Integer QUERY_PARAMETER_INFO_POSITION = 3;
    Integer PATH_PARAMETER_INFO_POSITION = 2;
    Integer HEADER_PARAMETER_INFO_POSITION = 1;

    /**
     * 默认http 超时时间
     */
    long DEFAULT_BARRIER_HTTP_TIME_OUT = 6000L;
    /**
     * 默认超时时间
     */
    long DEFAULT_RETRY_TIMES = 0;

    /**
     *
     */
    String REQUEST_START_TIME = "request.start.time";
    /**
     * 测试环境
     */
    String TEST_ENV = "TEST";
    /**
     *预发环境
     */
    String BETA_ENV = "BETA";
    /**
     *生产环境
     */
    String PROD_ENV = "PROD";
    /**
     * 请求环境标识
      */
    String HEADER_STAGE_TAG = "X-Ca-Stage";
    /**
     * 入参请求模式 1 入参映射（过滤未知参数）
     */
    Integer  PARAMETER_FILTER_MAPPING_MODEL = 1;
    /**
     * 入参请求模式 2 入参映射（透传未知参数）
     */
    Integer  PARAMETER_MAPPING_MODEL = 2;
    /**
     * 入参请求模式 3  入参透传
     */
    Integer PARAMETER_TRANSPARENT_MAPPING_MODEL = 3;
    /**
     * Spring Profile : "standalone"
     */
    String STANDALONE_SPRING_PROFILE = "standalone";
    /**
     * The System property name of  Standalone mode
     */
    String STANDALONE_MODE_PROPERTY_NAME = "barrier.standalone";
    /**
     * 精准匹配
     */
    Integer PRECISE_MATCH_TYPE = 1;
    /***
     * 模糊匹配
     */
    Integer FUZZY_MATCH_TYPE = 2;
}
